package com.pureut.storage.controller;

import com.pureut.common.core.web.domain.AjaxResult;
import com.pureut.storage.service.WarehouseSignageService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: YSL
 * @Date: 2023/5/4 11:39
 * @Desc: 仓库看板
 */
@RestController
@RequestMapping("/warehouseSignage")
public class WarehouseSignageController {

    @Resource
    WarehouseSignageService warehouseSignageService;

    /**
     * 查询仓库信息
     * @param warehouseCode
     * @return
     */
    @GetMapping("/getWarehouseBulletinBoard")
    public AjaxResult getWarehouseBulletinBoard(String warehouseCode) {
        return AjaxResult.success(warehouseSignageService.getWarehouseBulletinBoard(warehouseCode));
    }

    /**
     * 仓库库存情况
     * @param warehouseCode
     * @return
     */
    @GetMapping("/getWarehouseInventorySituationNumber")
    public AjaxResult getWarehouseInventorySituationNumber(String warehouseCode) {
        return AjaxResult.success(warehouseSignageService.getWarehouseInventorySituationNumber(warehouseCode));
    }

    /**
     * 仓库库存情况 库存量（吨）
     * @param warehouseCode
     * @return
     */
    @GetMapping("/getWarehouseInventory")
    public AjaxResult getWarehouseInventory(String warehouseCode) {
        return AjaxResult.success(warehouseSignageService.getWarehouseInventory(warehouseCode));
    }

    /**
     * 本月物料出入库统计
     * @param warehouseCode
     * @return
     */
    @GetMapping("/getMaterialStatisticsList")
    public AjaxResult getMaterialStatisticsList(String warehouseCode) {
        return AjaxResult.success(warehouseSignageService.getMaterialStatisticsList(warehouseCode));
    }

    /**
     * 库区物料情况
     * @param warehouseCode
     * @return
     */
    @GetMapping("/getWarehouseMaterialsSituationList")
    public AjaxResult getWarehouseMaterialsSituationList(String warehouseCode) {
        return AjaxResult.success(warehouseSignageService.getWarehouseMaterialsSituationList(warehouseCode));
    }

    /**
     * 库存周转率
     * @param warehouseCode
     * @return
     */
    @GetMapping("/getInventoryTurnoverRateList")
    public AjaxResult getInventoryTurnoverRateList(String warehouseCode) {
        return AjaxResult.success(warehouseSignageService.getInventoryTurnoverRateList(warehouseCode));
    }

    /**
     * 仓库告警信息
     * @param warehouseCode
     * @return
     */
    @GetMapping("/alarmInformationList")
    public AjaxResult AlarmInformationList(String warehouseCode) {
        return AjaxResult.success(warehouseSignageService.alarmInformationList(warehouseCode));
    }

    /**
     * 仓库告警内容
     * @param warehouseCode
     * @return
     */
    @GetMapping("/getAlarmContentDtoList")
    public AjaxResult getAlarmContentDtoList(String warehouseCode) {
        return AjaxResult.success(warehouseSignageService.getAlarmContentDtoList(warehouseCode));
    }
}
